import BuffUtil from '@/BuffUtil';
import BaseUtil from '@/BaseUtil';
import SelectCommon from 'code/Core/Common/SelectCommon';
export default class Item_夜月水光珠 {
    static id = 'C00C';
    static itemId = FourCC('C00C');
    static 名称: string = '夜月水光珠';
    static 描述: string = '增加法术暴击与法术暴击伤害';
    static 图标: string = 'assets\\item\\INV_Fishing_Innards_PearlBlack.blp';
    static buffId: string = 'buff_item_yeyueshuiguangzhu';
    static buffType: AppBuffType = {
        id: 'buff_item_yeyueshuiguangzhu',
        name: Item_夜月水光珠.名称,
        ubertip: Item_夜月水光珠.描述,
        art: Item_夜月水光珠.图标,
        attribute: {
            法术暴击机率: 0.05,
            法术暴击伤害: 0.55,
        },
        targetAttach: 'origin',
        targetArt: 'Ambition Aura\\Ambition_Aura_orange.mdx',
        dur: 4,
        class: '光环',
    };
    constructor() {
        BuffUtil.registerBuffType(Item_夜月水光珠.buffType);
        se.onUnitPickupItem(Item_夜月水光珠.spellEffect);
        BaseUtil.onTimer(1, Item_夜月水光珠.timerEffect);
    }
    static timerEffect() {
        for (let p of Item_夜月水光珠.providers) {
            let us = SelectCommon.getAllyUnitInRange(p, 700);
            for (let u of us) {
                BuffUtil.addBuff(u, Item_夜月水光珠.buffId);
            }
        }
        return true;
    }
    static providers: unit[] = [];
    static spellEffect() {
        let item = GetManipulatedItem();
        let u = GetTriggerUnit();
        if (GetItemTypeId(item) != Item_夜月水光珠.itemId) return;
        if (Item_夜月水光珠.providers.includes(u)) return;
        Item_夜月水光珠.providers.push(u);
    }
}
